package request

import "go.didapinche.com/foundation/plat-echo/app/ops/models"

type GraphDataReq struct {
	GraphID      uint64 `json:"graph_id" form:"graph_id"`
	Start        string `json:"start" form:"start"`
	End          string `json:"end" form:"end"`
	TimeStep     string `json:"time_step" form:"time_step"`
	LegendFormat string `json:"legend_format" form:"legend_format"`
	LinkFormat   string `json:"link_format" form:"link_format"`
	Expression   string `json:"expression" form:"expression"`
	Decimals     int    `gorm:"decimals" json:"decimals"`
}

type GraphTypeReq struct {
	DashboardID uint64 `json:"dashboard_id"`
}

type SubscribeReq struct {
	ID        uint64 `json:"id"`
	Subscribe bool   `form:"subscribe" json:"subscribe"`
	*SubscribeInfo
}
type SubscribeInfo struct {
	SubscribeType []models.SubscribeType `form:"subscribe_type" json:"subscribe_type,omitempty"`
	Owner         bool                   `form:"owner" json:"owner,omitempty"`
	Condition     *Condition             `form:"condition" json:"condition,omitempty"`
}
type Condition struct {
	Key   string `json:"key"`
	Op    string `json:"op"`
	Value []int  `json:"value"`
}

type Alert struct {
	ID     uint64 `json:"id"`
	Status int    `json:"status"`
}
